//
//  calenderView.h
//  CalenderDemo
//
//  Created by GZMLUser on 14-11-6.
//  Copyright (c) 2014年 GZMLUser. All rights reserved.
//

#import <UIKit/UIKit.h>
#import "DateDay.h"
typedef enum Type{ //动画类型
    Popping,       //弹性缩小放大
    Bottom,        //下
}Type;
@class calenderView;
@protocol calendarDayClickedDelegate <NSObject>

@optional
- (void)calendarDayClicked:(NSDate *)date;
- (void)calendarViewDoneClicked:(calenderView *)calenderView;
@end

@interface calenderView : UIView <DateDayDelegate,UIScrollViewDelegate>
{
    int _weeksOnCalendar; // 每页几周
    int _bufferDaysBeginning;
    int _daysInMonth;
    NSDate * _dateNoTime;
    NSCalendar *_calendar;
    CGFloat _calendarViewHeigth;// 日历高度
    BOOL (^_dateHasItemsCallback)(NSDate *);
    
    // scrollview重用
    UIView *_preView; // 前一个
    UIView *_secendPreView;
    UIView *_currView; // 当前
    UIView *_secendNextView;
    UIView *_nextView; // 下一个
 
    // 月份
    int monthIndex;
    int preIndex;

    int nexIndex;
}
@property (nonatomic, strong) NSDate *firstOfCurrentMonth;
@property (nonatomic, strong) DateDay *currentDay; // 当前选中的日期方格
@property (nonatomic, strong) NSDate *internalDate; // 选中的日期
@property (nonatomic,assign)Type type; // 类型
@property (nonatomic ,strong)NSDate *currentDate;

@property (nonatomic ,strong)UILabel *monthLabel; // 月份显示
@property (nonatomic, strong)UIView *calendarDaysView;// 日期列表View
@property (nonatomic,strong)UIView *weekDayView; // 星期一至星期天 View
@property (nonatomic,strong)UIView *superView; // 父View
@property (nonatomic,strong)UIView *calendarView; // 整个日历View
@property (nonatomic ,strong)UIScrollView *scrollView; // 日期列表父View

@property (nonatomic,weak)id<calendarDayClickedDelegate> delegate;

- (id)initWithAnimateTye:(Type)animateType andDate:(NSDate *)date addToSuperView:(UIView *)superView;

@end
